#include "jami.h"
#include "ui_jami.h"
#include <QDate>
Jami::Jami(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Jami)
{
    ui->setupUi(this);
}

Jami::~Jami()
{
    delete ui;
}

void Jami::on_pushButton_clicked()
{
    Download *dlg1=new Download(this);
    dlg1->show();
    dlg1->ui->editUrl->setText("https://dl.jami.net/ring-manual/ubuntu_22.10/jami-all_amd64.deb");
    QString addres = dlg1->ui->editPath->text();
    QSqlQuery query;
    QDate date1 = QDate::currentDate();
    query.prepare("insert into user(SaveAddress,InstallationTime,SoftwareName) values (:SaveAddress,:InstallationTime,:SoftwareName)");
    query.bindValue(":SoftwareName","Jami");
    query.bindValue(":SaveAddress",addres);
    query.bindValue(":InstallationTime",date1);
    query.exec();
}



void Jami::on_pushButton_3_clicked()
{
    if(func_findname(softwarename))
    {
        uninstall *dlg = new uninstall(this);
        dlg->show();
    }
    else
    {
        QMessageBox::information(NULL,"infor","no this software");
    }
}
